﻿@model UdostepniaczPlikow.ViewModels.UserSelectionViewModel

@{
    
    ViewBag.Title = "Uprawnienia";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Uprawnienia</h2>

@{
    
    MultiSelectList lista1 = new MultiSelectList(Model.AvailableUsers);
    MultiSelectList lista2 = new MultiSelectList(Model.SelectedUsers);
   
}

                @{
                    List<SelectListItem> lista3 = new List<SelectListItem>{
                        new SelectListItem{ Text="Wszyscy" },
                        new SelectListItem{ Text="Grupa1" },
                        new SelectListItem{ Text="Grupa2" },
                        new SelectListItem{ Text="Grupa3" },
                    };
                }
@using (Html.BeginForm("UprawnieniaDodaj", "File", FormMethod.Post, new { lista1.SelectedValues }))
{
<div class="grid">
    <div class="row">
        <div class="span2">
            @Html.DropDownList("grupy", lista3)
        </div>
    </div>
    <br />
    <div class="row">
        
        <div class="span2">
            <div id="list1">
              @Html.ListBox("lista1", lista1, new { size = 15 })
               

            </div>
        </div>

        <div class="span2">
            <div class="uprawnieniaButtons">
                <div class="linkbutton">@Html.ActionLink("====>", "UprawnieniaDodaj", "File", new { lista1.SelectedValues })</div>
                <div class="linkbutton">@Html.ActionLink("<====", "UprawnieniaUsun", "File", new { lista2.SelectedValues })</div>
                @*<input type="submit" name="Dodaj" title="Dodaj" value="===>"/>
                <input type="button" name="Usun" title="Usun" value="<===" />*@
            </div>

        </div>

        <div class="span3">
            <div id="list2">

                @Html.ListBox("lista2", lista2, new { size = 15 })

            </div>
        </div>
    </div>

</div>
}